<script language="javascript" type="text/javascript">
	$.getScript('js/feature.tab.js', function() {
		featurePageLoaded('history');
	});
</script>

<div class="header">	
	<div class="pageLinks">
		<a href="#/機能" onclick="loadPage('機能');return false;">機能</a> &gt; 
		<strong>履歴</strong>
	</div>
	<div class="Group_name">
		グループ： <?php echo $group_name ?>
	</div>
	<div class="Help" style="position:absolute;top:55px;left:652px;">
		<img src="image/Help_Button.gif" onclick="showHelp('history');" />
	</div>
</div>

<div class="tab_content">

<?php require($SETTINGS['VIEW_PATH'] . "messages" . $SETTINGS['VIEW_NAME']) ?>

	<table style="border: 0px;">
		<tr>
			<th style="width:145px"><label for="history_type">タイプ</label></th>
			<th style="width:290px" colspan="3"><label for="history_start_date">表示する期間</label></th>
			<th style="width:145px"><label for="history_user">作成ユーザー</label></th>
			<th></th>
		</tr>
			
		<tr>
			<td>
				<select name="history_type" style="width:145px" id="history_type">
					<option value="all">--　指定なし　--</option>
					<option value="check" <?php if ($type_value == "check") {?> selected="selected" <? } ?>>挙手</option>
					<option value="vote" <?php if ($type_value == "vote") {?> selected="selected" <? } ?>>アンケート</option>
				</select>
			</td>
			<td>
				<input type="text" id="history_start_date" style="width:100px;" value="<?php echo $start_date_value; ?>">
			</td>
			<td>－</td>
			<td>
				<input type="text" id="history_end_date" style="width:100px;" value="<?php echo $end_date_value; ?>">
			</td>
			<td>
				<select name="history_user" style="width:145px" id="history_user">
					<option value="">--　指定なし　--</option>
				<?php foreach ($history as $key => $value) { ?>
					<option value="<?php echo $key ?>"
					<?php if ($user_value == $key) { ?>
						selected="selected"
					<?php } ?>
					><?php echo $value ?></option>
				<?php } ?>
				</select>
			</td>
			<td>
				<input style="float:right;" id="historySearchButton" type="button" value="絞り込み" onclick="searchHistory();" />
			</td>
		</tr>
	</table>

	<table class="historyTable" border="1" width="100%" cellpadding="2" cellspacing="2">
		<tr class="titleRow"><td colspan="5">履歴一覧</td></tr>
		<tr>
			<th  width="13%" style="font-size:12px;">種類</th>
			<th  width="11%" style="font-size:12px;">アイコン</th>
			<th  width="27%" style="font-size:12px;">名前</th>
			<th  width="26%" style="font-size:12px;">内容</th>
			<th  width="23%" style="font-size:12px;">投稿時間</th>
		</tr>
		<tr class="historyTableRow template" style="display:none;">
			<input type="hidden" name="id" value="" />
			<td>
				<span name="type"></span>
			</td>
			<td style="text-align:center;padding:5px 3px 3px 3px;">
				<img width="46" name="icon" src="">
			</td>
			<td>
				<span name="name"></span><br />
				(<span name="twitter_name"></span>)
			</td>
			<td>
				<span name="comment"></span>
			</td>
			<td>
				<span name="date_year"></span>
				<br /><span name="date_time"></span>
			</td>
		</tr>
		<tr class="noRows"
			<?php if (!empty($found)) { ?>
				style="display:none;"
			<?php } ?>
		>
			<td colspan="5">
				<?php echo $MESSAGES['HISTORY_NO_RESULTS']; ?>
			</td>
		</tr>
			<?php if (!empty($found)) {
					foreach ($found as $tweet) { ?>
				<tr class="historyTableRow">
					<td>
						<span name="type"><?php echo $tweet->type; ?></span>
					</td>
					<td style="text-align:center;padding:5px 3px 3px 3px;">
						<img width="46" name="icon" src="<?php echo $tweet->icon; ?>">
					</td>
					<td>
						<span name="name"><?php echo $tweet->name; ?></span><br />
						(<span name="twitter_name"><?php echo $tweet->author; ?></span>)
					</td>
					<td>
						<input type="hidden" name="id" value="<?php echo $tweet->id; ?>" />
						<span name="comment"><?php echo $tweet->comment; ?></span>
					</td>
					<td>
						<span name="date_year"><?php echo date("Y年m月d日", $tweet->date); ?></span>
						<br /><span name="date_time"><?php echo date("H:i", $tweet->date); ?></span>
					</td>
				</tr>
			<?php 
				}
			} ?>
	</table>
</div>